<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/timer.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__timer_2include_2hardware_2timer_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">timer.h</div></div>
</div><!--header-->
<div class="contents">
<a href="rp2__common_2hardware__timer_2include_2hardware_2timer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_TIMER_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_TIMER_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;hardware/structs/timer.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &quot;hardware/regs/intctrl.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER, Enable/disable assertions in the hardware_timer module, type=bool, default=0, group=hardware_timer</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_TIMER </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER PARAM_ASSERTIONS_ENABLED_TIMER</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER 0</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="preprocessor">#ifndef TIMER_NUM</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span><span class="preprocessor">#define TIMER_NUM(timer) ({ (void) (timer); 0; })</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span><span class="preprocessor">#elif NUM_GENERIC_TIMERS == 2</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span><span class="preprocessor">#define TIMER_NUM(timer) ((timer) == timer1_hw)</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span><span class="preprocessor">#ifndef TIMER_INSTANCE</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span><span class="preprocessor">#define TIMER_INSTANCE(num) timer_hw</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span><span class="preprocessor">#elif NUM_GENERIC_TIMERS == 2</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="preprocessor">#define TIMER_INSTANCE(num) ((num) ? timer1_hw : timer0_hw)</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span><span class="preprocessor">#ifndef TIMER_ALARM_IRQ_NUM</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3aa85dca1accc78d56c18c8a2c2e842b42">TIMER_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3a9adcee3ff00b51d885e399d87fd6c957">TIMER_IRQ_0</a> + 3, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span><span class="preprocessor">#define TIMER_ALARM_IRQ_NUM(timer, alarm_num) (TIMER_IRQ_0 + (alarm_num))</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8af2fb391af7b873b5268e3824068d08c0">TIMER1_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a8aefc9b5ce0307f2983c7cfe9cfcee0e">TIMER0_IRQ_0</a> + 7, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga7087b84f4fb4ecce424000c90fce84e4">  111</a></span><span class="preprocessor">#define TIMER_ALARM_IRQ_NUM(timer, alarm_num) (TIMER0_IRQ_0 + TIMER_NUM(timer) * NUM_ALARMS + (alarm_num))</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="preprocessor">#ifndef TIMER_ALARM_NUM_FROM_IRQ</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3aa85dca1accc78d56c18c8a2c2e842b42">TIMER_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3a9adcee3ff00b51d885e399d87fd6c957">TIMER_IRQ_0</a> + 3, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span><span class="preprocessor">#define TIMER_ALARM_NUM_FROM_IRQ(irq_num) (((irq_num) - TIMER_IRQ_0) &amp; 3u)</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8af2fb391af7b873b5268e3824068d08c0">TIMER1_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a8aefc9b5ce0307f2983c7cfe9cfcee0e">TIMER0_IRQ_0</a> + 7, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#gad96d6d69599253d1880356a4d71ecf19">  129</a></span><span class="preprocessor">#define TIMER_ALARM_NUM_FROM_IRQ(irq_num) (((irq_num) - TIMER0_IRQ_0) &amp; 3u)</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span><span class="preprocessor">#ifndef TIMER_NUM_FROM_IRQ</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3aa85dca1accc78d56c18c8a2c2e842b42">TIMER_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3a9adcee3ff00b51d885e399d87fd6c957">TIMER_IRQ_0</a> + 3, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span><span class="preprocessor">#define TIMER_NUM_FROM_IRQ(irq_num) (((irq_num) - TIMER_IRQ_0) &gt;&gt; 2)</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8af2fb391af7b873b5268e3824068d08c0">TIMER1_IRQ_3</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a8aefc9b5ce0307f2983c7cfe9cfcee0e">TIMER0_IRQ_0</a> + 7, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#gab3d512da219783a171937d52f17c19d4">  147</a></span><span class="preprocessor">#define TIMER_NUM_FROM_IRQ(irq_num) (((irq_num) - TIMER0_IRQ_0) &gt;&gt; 2)</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_TIMER, Timer instance number to use for RP2040-period hardware_timer APIs that assumed a single timer instance, min=0, max=1, default=0, group=hardware_timer</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span> </div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span><span class="preprocessor">#ifndef PICO_DEFAULT_TIMER</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga8ab54d1221d9318ac36daa9790660d8b">  164</a></span><span class="preprocessor">#define PICO_DEFAULT_TIMER 0</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span><span class="preprocessor">#ifndef PICO_DEFAULT_TIMER_INSTANCE</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span><span class="preprocessor">#if NUM_GENERIC_TIMERS == 1</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span><span class="preprocessor">#if PICO_DEFAULT_TIMER</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="preprocessor">#error Setting PICO_DEFAULT_TIMER to non zero is meaningless as there is only one TIMER instance on this platform</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span><span class="preprocessor">#define PICO_DEFAULT_TIMER_INSTANCE() timer_hw</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga929d2a5b281a0f0321a4273f63ca9ce3">  182</a></span><span class="preprocessor">#define PICO_DEFAULT_TIMER_INSTANCE() (__CONCAT(__CONCAT(timer,PICO_DEFAULT_TIMER), _hw))</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span><span class="comment">// also define timer_hw for backwards compatibility (just accesses the default instance)</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span><span class="preprocessor">#define timer_hw PICO_DEFAULT_TIMER_INSTANCE()</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_hardware_alarm_num_param(__unused uint alarm_num) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>    invalid_params_if(HARDWARE_TIMER, alarm_num &gt;= NUM_ALARMS);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>}</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga2b3cd8f1226824b3a85fb2bca66e70fd">  202</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__timer.html#ga2b3cd8f1226824b3a85fb2bca66e70fd">timer_time_us_32</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer) {</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>    <span class="keywordflow">return</span> timer-&gt;timerawl;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>}</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span> </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#gabfffa28d8715f71834934f357e7dc091">  215</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__timer.html#gabfffa28d8715f71834934f357e7dc091">time_us_32</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__timer.html#ga2b3cd8f1226824b3a85fb2bca66e70fd">timer_time_us_32</a>(<a class="code hl_define" href="group__hardware__timer.html#ga929d2a5b281a0f0321a4273f63ca9ce3">PICO_DEFAULT_TIMER_INSTANCE</a>());</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>}</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span> </div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>uint64_t <a class="code hl_function" href="group__hardware__timer.html#ga937b4fb64eb4c7cc59464b38365d72d9">timer_time_us_64</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> </div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>uint64_t <a class="code hl_function" href="group__hardware__timer.html#ga7bbcd996dbd3dd4adc03a80272fb2fc3">time_us_64</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga9eaeafc2c64a5f1d5e0ddef2c7d4bbec">timer_busy_wait_us_32</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint32_t delay_us);</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span> </div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga89b0f1dcbbdf81c92ade2930e8e38ab6">busy_wait_us_32</a>(uint32_t delay_us);</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gaa129f3464b270d9e820605a7237c422a">timer_busy_wait_us</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint64_t delay_us);</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span> </div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gac089d1c42bb7658bb43c798454f66e2f">busy_wait_us</a>(uint64_t delay_us);</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span> </div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gac61c07fc2cc25c340be6e8f6e61fd30a">timer_busy_wait_ms</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint32_t delay_ms);</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga17519ddf048fbdf533decf9e77c956d4">busy_wait_ms</a>(uint32_t delay_ms);</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga93c8c8020551f0656c3f59335aa823d6">timer_busy_wait_until</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, <a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t);</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span> </div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gab1c72f391015ff00a96b24477aa327ee">busy_wait_until</a>(<a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span> </div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga2a8c570e4536f0ceab896475ac5cc5e7">  320</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga2a8c570e4536f0ceab896475ac5cc5e7">timer_time_reached</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, <a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t) {</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span>    uint64_t target = <a class="code hl_function" href="group__timestamp.html#ga173698876ae00331c92ed4e8c3ba98d1">to_us_since_boot</a>(t);</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>    uint32_t hi_target = (uint32_t)(target &gt;&gt; 32u);</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>    uint32_t hi = timer-&gt;timerawh;</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span>    <span class="keywordflow">return</span> (hi &gt;= hi_target &amp;&amp; (timer-&gt;timerawl &gt;= (uint32_t) target || hi != hi_target));</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span>}</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span> </div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga1e41eca96d5c1b3b5e69e3b1a00cdf7d">  334</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga1e41eca96d5c1b3b5e69e3b1a00cdf7d">time_reached</a>(<a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t) {</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__timer.html#ga2a8c570e4536f0ceab896475ac5cc5e7">timer_time_reached</a>(<a class="code hl_define" href="group__hardware__timer.html#ga929d2a5b281a0f0321a4273f63ca9ce3">PICO_DEFAULT_TIMER_INSTANCE</a>(), t);</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>}</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#gaf2ca140ecc0d1e8087b584ed3707b80a">  344</a></span><span class="keyword">typedef</span> void (*<a class="code hl_typedef" href="group__hardware__timer.html#gaf2ca140ecc0d1e8087b584ed3707b80a">hardware_alarm_callback_t</a>)(uint alarm_num);</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno">  345</span> </div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno">  356</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gaa4e5b9946e1ce19788b46b8bf9987a4b">timer_hardware_alarm_claim</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num);</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno">  357</span> </div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga51e6919f4f860e59e9d6f5403805cb8f">hardware_alarm_claim</a>(uint alarm_num);</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span> </div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__timer.html#ga8942fc87edfb495a2dd75a4703700642">timer_hardware_alarm_claim_unused</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, <span class="keywordtype">bool</span> required);</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span> </div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__timer.html#ga4500581b13256638c00054d85870c1f2">hardware_alarm_claim_unused</a>(<span class="keywordtype">bool</span> required);</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span> </div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno">  402</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gac8ff547eecf2fd3eb1124cd3a5afe85a">timer_hardware_alarm_unclaim</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num);</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno">  403</span> </div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga0d9ea3c5f1d4ea94812b338afbcef7e5">hardware_alarm_unclaim</a>(uint alarm_num);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span> </div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga46d3b463f5ea48b21e285fe06e2960fe">timer_hardware_alarm_is_claimed</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num);</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span> </div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno">  432</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga6a5ed8cbc0ddea150ba932810ddef2e0">hardware_alarm_is_claimed</a>(uint alarm_num);</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span> </div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno">  452</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga1f7d02607a27915fea3b99a65319d3c1">timer_hardware_alarm_set_callback</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num, <a class="code hl_typedef" href="group__hardware__timer.html#gaf2ca140ecc0d1e8087b584ed3707b80a">hardware_alarm_callback_t</a> callback);</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno">  453</span> </div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gaa4c3c72008c100ca25f94b806f13f112">hardware_alarm_set_callback</a>(uint alarm_num, <a class="code hl_typedef" href="group__hardware__timer.html#gaf2ca140ecc0d1e8087b584ed3707b80a">hardware_alarm_callback_t</a> callback);</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga8590dbfd69db9c3da5b628cd81efc22d">timer_hardware_alarm_set_target</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num, <a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t);</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span> </div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__timer.html#ga62098633d173c24c56c359df2e886ed2">hardware_alarm_set_target</a>(uint alarm_num, <a class="code hl_typedef" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> t);</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span> </div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno">  508</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#gabdb6ba35d83bbf4e3d385821fef7fd05">timer_hardware_alarm_cancel</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num);</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span> </div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno">  517</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga5bc42f680998e4c30fb7389fee9aa59f">hardware_alarm_cancel</a>(uint alarm_num);</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno">  518</span> </div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga638f76034b217ff7f8999ca16b919f63">timer_hardware_alarm_force_irq</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num);</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span> </div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno">  548</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__timer.html#ga5182b9f67e7f878548460f6f57e22ec0">hardware_alarm_force_irq</a>(uint alarm_num);</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno">  549</span> </div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga3531b9148290b15a491cfb6e6aafa850">  557</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__timer.html#ga3531b9148290b15a491cfb6e6aafa850">timer_hardware_alarm_get_irq_num</a>(__unused <a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num) {</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno">  558</span>    check_hardware_alarm_num_param(alarm_num);</div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno">  559</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__timer.html#ga7087b84f4fb4ecce424000c90fce84e4">TIMER_ALARM_IRQ_NUM</a>(timer, alarm_num);</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span>}</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span> </div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga4ab38331811cb4dd911385666b5f51a1">  568</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__timer.html#ga4ab38331811cb4dd911385666b5f51a1">hardware_alarm_get_irq_num</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer, uint alarm_num) {</div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__timer.html#ga3531b9148290b15a491cfb6e6aafa850">timer_hardware_alarm_get_irq_num</a>(<a class="code hl_define" href="group__hardware__timer.html#ga929d2a5b281a0f0321a4273f63ca9ce3">PICO_DEFAULT_TIMER_INSTANCE</a>(), alarm_num);</div>
<div class="line"><a id="l00570" name="l00570"></a><span class="lineno">  570</span>}</div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno">  571</span> </div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga6e6a907da0b44a8fb2db2277ad05079c">  580</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__timer.html#ga6e6a907da0b44a8fb2db2277ad05079c">timer_get_index</a>(<a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *timer) {</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>    <span class="keywordflow">return</span> TIMER_NUM(timer);</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span>}</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span> </div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno"><a class="line" href="group__hardware__timer.html#ga1a268fc4a0ad01d2879a7a7334cf9984">  591</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_struct" href="structtimer__hw__t.html">timer_hw_t</a> *<a class="code hl_function" href="group__hardware__timer.html#ga1a268fc4a0ad01d2879a7a7334cf9984">timer_get_instance</a>(uint timer_num) {</div>
<div class="line"><a id="l00592" name="l00592"></a><span class="lineno">  592</span>    invalid_params_if(HARDWARE_TIMER, timer_num &gt;= NUM_GENERIC_TIMERS);</div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno">  593</span>    <span class="keywordflow">return</span> TIMER_INSTANCE(timer_num);</div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno">  594</span>}</div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno">  595</span> </div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno">  596</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno">  597</span>}</div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno">  599</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8a8aefc9b5ce0307f2983c7cfe9cfcee0e"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a8aefc9b5ce0307f2983c7cfe9cfcee0e">TIMER0_IRQ_0</a></div><div class="ttdeci">@ TIMER0_IRQ_0</div><div class="ttdoc">Select TIMER0's IRQ 0 output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:74</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8af2fb391af7b873b5268e3824068d08c0"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8af2fb391af7b873b5268e3824068d08c0">TIMER1_IRQ_3</a></div><div class="ttdeci">@ TIMER1_IRQ_3</div><div class="ttdoc">Select TIMER1's IRQ 3 output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:81</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ggaf4bf6b287c1a8445fce49ccaa711b3c3a9adcee3ff00b51d885e399d87fd6c957"><div class="ttname"><a href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3a9adcee3ff00b51d885e399d87fd6c957">TIMER_IRQ_0</a></div><div class="ttdeci">@ TIMER_IRQ_0</div><div class="ttdoc">Select TIMER's IRQ 0 output.</div><div class="ttdef"><b>Definition:</b> intctrl_rp2040.h:48</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ggaf4bf6b287c1a8445fce49ccaa711b3c3aa85dca1accc78d56c18c8a2c2e842b42"><div class="ttname"><a href="group__hardware__irq.html#ggaf4bf6b287c1a8445fce49ccaa711b3c3aa85dca1accc78d56c18c8a2c2e842b42">TIMER_IRQ_3</a></div><div class="ttdeci">@ TIMER_IRQ_3</div><div class="ttdoc">Select TIMER's IRQ 3 output.</div><div class="ttdef"><b>Definition:</b> intctrl_rp2040.h:51</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga0d9ea3c5f1d4ea94812b338afbcef7e5"><div class="ttname"><a href="group__hardware__timer.html#ga0d9ea3c5f1d4ea94812b338afbcef7e5">hardware_alarm_unclaim</a></div><div class="ttdeci">void hardware_alarm_unclaim(uint alarm_num)</div><div class="ttdoc">cooperatively release the claim on use of this hardware alarm_num on the default timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:35</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga17519ddf048fbdf533decf9e77c956d4"><div class="ttname"><a href="group__hardware__timer.html#ga17519ddf048fbdf533decf9e77c956d4">busy_wait_ms</a></div><div class="ttdeci">void busy_wait_ms(uint32_t delay_ms)</div><div class="ttdoc">Busy wait wasting cycles for the given number of milliseconds using the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:137</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga1a268fc4a0ad01d2879a7a7334cf9984"><div class="ttname"><a href="group__hardware__timer.html#ga1a268fc4a0ad01d2879a7a7334cf9984">timer_get_instance</a></div><div class="ttdeci">static timer_hw_t * timer_get_instance(uint timer_num)</div><div class="ttdoc">Returns the timer instance with the given timer number.</div><div class="ttdef"><b>Definition:</b> timer.h:591</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga1e41eca96d5c1b3b5e69e3b1a00cdf7d"><div class="ttname"><a href="group__hardware__timer.html#ga1e41eca96d5c1b3b5e69e3b1a00cdf7d">time_reached</a></div><div class="ttdeci">static bool time_reached(absolute_time_t t)</div><div class="ttdoc">Check if the specified timestamp has been reached on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:334</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga1f7d02607a27915fea3b99a65319d3c1"><div class="ttname"><a href="group__hardware__timer.html#ga1f7d02607a27915fea3b99a65319d3c1">timer_hardware_alarm_set_callback</a></div><div class="ttdeci">void timer_hardware_alarm_set_callback(timer_hw_t *timer, uint alarm_num, hardware_alarm_callback_t callback)</div><div class="ttdoc">Enable/Disable a callback for a hardware alarm for a given timer instance on this core.</div><div class="ttdef"><b>Definition:</b> timer.c:183</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga2a8c570e4536f0ceab896475ac5cc5e7"><div class="ttname"><a href="group__hardware__timer.html#ga2a8c570e4536f0ceab896475ac5cc5e7">timer_time_reached</a></div><div class="ttdeci">static bool timer_time_reached(timer_hw_t *timer, absolute_time_t t)</div><div class="ttdoc">Check if the specified timestamp has been reached on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:320</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga2b3cd8f1226824b3a85fb2bca66e70fd"><div class="ttname"><a href="group__hardware__timer.html#ga2b3cd8f1226824b3a85fb2bca66e70fd">timer_time_us_32</a></div><div class="ttdeci">static uint32_t timer_time_us_32(timer_hw_t *timer)</div><div class="ttdoc">Return a 32 bit timestamp value in microseconds for a given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:202</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga3531b9148290b15a491cfb6e6aafa850"><div class="ttname"><a href="group__hardware__timer.html#ga3531b9148290b15a491cfb6e6aafa850">timer_hardware_alarm_get_irq_num</a></div><div class="ttdeci">static uint timer_hardware_alarm_get_irq_num(__unused timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">Returns the irq_num_t for the alarm interrupt from the given alarm on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:557</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga4500581b13256638c00054d85870c1f2"><div class="ttname"><a href="group__hardware__timer.html#ga4500581b13256638c00054d85870c1f2">hardware_alarm_claim_unused</a></div><div class="ttdeci">int hardware_alarm_claim_unused(bool required)</div><div class="ttdoc">cooperatively claim the use of a hardware alarm_num on the default timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:52</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga46d3b463f5ea48b21e285fe06e2960fe"><div class="ttname"><a href="group__hardware__timer.html#ga46d3b463f5ea48b21e285fe06e2960fe">timer_hardware_alarm_is_claimed</a></div><div class="ttdeci">bool timer_hardware_alarm_is_claimed(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">Determine if a hardware alarm has been claimed on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:39</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga4ab38331811cb4dd911385666b5f51a1"><div class="ttname"><a href="group__hardware__timer.html#ga4ab38331811cb4dd911385666b5f51a1">hardware_alarm_get_irq_num</a></div><div class="ttdeci">static uint hardware_alarm_get_irq_num(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">Returns the irq_num_t for the alarm interrupt from the given alarm on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:568</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga5182b9f67e7f878548460f6f57e22ec0"><div class="ttname"><a href="group__hardware__timer.html#ga5182b9f67e7f878548460f6f57e22ec0">hardware_alarm_force_irq</a></div><div class="ttdeci">void hardware_alarm_force_irq(uint alarm_num)</div><div class="ttdoc">Force and IRQ for a specific hardware alarm on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:292</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga51e6919f4f860e59e9d6f5403805cb8f"><div class="ttname"><a href="group__hardware__timer.html#ga51e6919f4f860e59e9d6f5403805cb8f">hardware_alarm_claim</a></div><div class="ttdeci">void hardware_alarm_claim(uint alarm_num)</div><div class="ttdoc">cooperatively claim the use of this hardware alarm_num on the default timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:26</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga5bc42f680998e4c30fb7389fee9aa59f"><div class="ttname"><a href="group__hardware__timer.html#ga5bc42f680998e4c30fb7389fee9aa59f">hardware_alarm_cancel</a></div><div class="ttdeci">void hardware_alarm_cancel(uint alarm_num)</div><div class="ttdoc">Cancel an existing target (if any) for the specified hardware_alarm on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:279</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga62098633d173c24c56c359df2e886ed2"><div class="ttname"><a href="group__hardware__timer.html#ga62098633d173c24c56c359df2e886ed2">hardware_alarm_set_target</a></div><div class="ttdeci">bool hardware_alarm_set_target(uint alarm_num, absolute_time_t t)</div><div class="ttdoc">Set the current target for the specified hardware alarm on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:265</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga638f76034b217ff7f8999ca16b919f63"><div class="ttname"><a href="group__hardware__timer.html#ga638f76034b217ff7f8999ca16b919f63">timer_hardware_alarm_force_irq</a></div><div class="ttdeci">void timer_hardware_alarm_force_irq(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">Force and IRQ for a specific hardware alarm on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:283</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga6a5ed8cbc0ddea150ba932810ddef2e0"><div class="ttname"><a href="group__hardware__timer.html#ga6a5ed8cbc0ddea150ba932810ddef2e0">hardware_alarm_is_claimed</a></div><div class="ttdeci">bool hardware_alarm_is_claimed(uint alarm_num)</div><div class="ttdoc">Determine if a hardware alarm has been claimed on the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:44</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga6e6a907da0b44a8fb2db2277ad05079c"><div class="ttname"><a href="group__hardware__timer.html#ga6e6a907da0b44a8fb2db2277ad05079c">timer_get_index</a></div><div class="ttdeci">static uint timer_get_index(timer_hw_t *timer)</div><div class="ttdoc">Returns the timer number for a timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:580</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga7087b84f4fb4ecce424000c90fce84e4"><div class="ttname"><a href="group__hardware__timer.html#ga7087b84f4fb4ecce424000c90fce84e4">TIMER_ALARM_IRQ_NUM</a></div><div class="ttdeci">#define TIMER_ALARM_IRQ_NUM(timer, alarm_num)</div><div class="ttdoc">Returns the irq_num_t for the alarm interrupt from the given alarm on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:111</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga7bbcd996dbd3dd4adc03a80272fb2fc3"><div class="ttname"><a href="group__hardware__timer.html#ga7bbcd996dbd3dd4adc03a80272fb2fc3">time_us_64</a></div><div class="ttdeci">uint64_t time_us_64(void)</div><div class="ttdoc">Return the current 64 bit timestamp value in microseconds for the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:125</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga8590dbfd69db9c3da5b628cd81efc22d"><div class="ttname"><a href="group__hardware__timer.html#ga8590dbfd69db9c3da5b628cd81efc22d">timer_hardware_alarm_set_target</a></div><div class="ttdeci">bool timer_hardware_alarm_set_target(timer_hw_t *timer, uint alarm_num, absolute_time_t t)</div><div class="ttdoc">Set the current target for a specific hardware alarm on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:215</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga8942fc87edfb495a2dd75a4703700642"><div class="ttname"><a href="group__hardware__timer.html#ga8942fc87edfb495a2dd75a4703700642">timer_hardware_alarm_claim_unused</a></div><div class="ttdeci">int timer_hardware_alarm_claim_unused(timer_hw_t *timer, bool required)</div><div class="ttdoc">cooperatively claim the use of a hardware alarm_num on the given timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:48</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga89b0f1dcbbdf81c92ade2930e8e38ab6"><div class="ttname"><a href="group__hardware__timer.html#ga89b0f1dcbbdf81c92ade2930e8e38ab6">busy_wait_us_32</a></div><div class="ttdeci">void busy_wait_us_32(uint32_t delay_us)</div><div class="ttdoc">Busy wait wasting cycles for the given (32 bit) number of microseconds using the default timer instan...</div><div class="ttdef"><b>Definition:</b> timer.c:129</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga929d2a5b281a0f0321a4273f63ca9ce3"><div class="ttname"><a href="group__hardware__timer.html#ga929d2a5b281a0f0321a4273f63ca9ce3">PICO_DEFAULT_TIMER_INSTANCE</a></div><div class="ttdeci">#define PICO_DEFAULT_TIMER_INSTANCE()</div><div class="ttdoc">Returns the default timer instance on the platform based on the setting of PICO_DEFAULT_TIMER.</div><div class="ttdef"><b>Definition:</b> timer.h:182</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga937b4fb64eb4c7cc59464b38365d72d9"><div class="ttname"><a href="group__hardware__timer.html#ga937b4fb64eb4c7cc59464b38365d72d9">timer_time_us_64</a></div><div class="ttdeci">uint64_t timer_time_us_64(timer_hw_t *timer)</div><div class="ttdoc">Return the current 64 bit timestamp value in microseconds for a given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:57</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga93c8c8020551f0656c3f59335aa823d6"><div class="ttname"><a href="group__hardware__timer.html#ga93c8c8020551f0656c3f59335aa823d6">timer_busy_wait_until</a></div><div class="ttdeci">void timer_busy_wait_until(timer_hw_t *timer, absolute_time_t t)</div><div class="ttdoc">Busy wait wasting cycles until after the specified timestamp using the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:110</div></div>
<div class="ttc" id="agroup__hardware__timer_html_ga9eaeafc2c64a5f1d5e0ddef2c7d4bbec"><div class="ttname"><a href="group__hardware__timer.html#ga9eaeafc2c64a5f1d5e0ddef2c7d4bbec">timer_busy_wait_us_32</a></div><div class="ttdeci">void timer_busy_wait_us_32(timer_hw_t *timer, uint32_t delay_us)</div><div class="ttdoc">Busy wait wasting cycles for the given (32 bit) number of microseconds using the given timer instance...</div><div class="ttdef"><b>Definition:</b> timer.c:77</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gaa129f3464b270d9e820605a7237c422a"><div class="ttname"><a href="group__hardware__timer.html#gaa129f3464b270d9e820605a7237c422a">timer_busy_wait_us</a></div><div class="ttdeci">void timer_busy_wait_us(timer_hw_t *timer, uint64_t delay_us)</div><div class="ttdoc">Busy wait wasting cycles for the given (64 bit) number of microseconds using the given timer instance...</div><div class="ttdef"><b>Definition:</b> timer.c:90</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gaa4c3c72008c100ca25f94b806f13f112"><div class="ttname"><a href="group__hardware__timer.html#gaa4c3c72008c100ca25f94b806f13f112">hardware_alarm_set_callback</a></div><div class="ttdeci">void hardware_alarm_set_callback(uint alarm_num, hardware_alarm_callback_t callback)</div><div class="ttdoc">Enable/Disable a callback for a hardware alarm on the default timer instance on this core.</div><div class="ttdef"><b>Definition:</b> timer.c:211</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gaa4e5b9946e1ce19788b46b8bf9987a4b"><div class="ttname"><a href="group__hardware__timer.html#gaa4e5b9946e1ce19788b46b8bf9987a4b">timer_hardware_alarm_claim</a></div><div class="ttdeci">void timer_hardware_alarm_claim(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">cooperatively claim the use of this hardware alarm_num on the given timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:21</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gab1c72f391015ff00a96b24477aa327ee"><div class="ttname"><a href="group__hardware__timer.html#gab1c72f391015ff00a96b24477aa327ee">busy_wait_until</a></div><div class="ttdeci">void busy_wait_until(absolute_time_t t)</div><div class="ttdoc">Busy wait wasting cycles until after the specified timestamp using the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:142</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gabdb6ba35d83bbf4e3d385821fef7fd05"><div class="ttname"><a href="group__hardware__timer.html#gabdb6ba35d83bbf4e3d385821fef7fd05">timer_hardware_alarm_cancel</a></div><div class="ttdeci">void timer_hardware_alarm_cancel(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">Cancel an existing target (if any) for a specific hardware_alarm on the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:269</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gabfffa28d8715f71834934f357e7dc091"><div class="ttname"><a href="group__hardware__timer.html#gabfffa28d8715f71834934f357e7dc091">time_us_32</a></div><div class="ttdeci">static uint32_t time_us_32(void)</div><div class="ttdoc">Return a 32 bit timestamp value in microseconds for the default timer instance.</div><div class="ttdef"><b>Definition:</b> timer.h:215</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gac089d1c42bb7658bb43c798454f66e2f"><div class="ttname"><a href="group__hardware__timer.html#gac089d1c42bb7658bb43c798454f66e2f">busy_wait_us</a></div><div class="ttdeci">void busy_wait_us(uint64_t delay_us)</div><div class="ttdoc">Busy wait wasting cycles for the given (64 bit) number of microseconds using the default timer instan...</div><div class="ttdef"><b>Definition:</b> timer.c:133</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gac61c07fc2cc25c340be6e8f6e61fd30a"><div class="ttname"><a href="group__hardware__timer.html#gac61c07fc2cc25c340be6e8f6e61fd30a">timer_busy_wait_ms</a></div><div class="ttdeci">void timer_busy_wait_ms(timer_hw_t *timer, uint32_t delay_ms)</div><div class="ttdoc">Busy wait wasting cycles for the given number of milliseconds using the given timer instance.</div><div class="ttdef"><b>Definition:</b> timer.c:101</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gac8ff547eecf2fd3eb1124cd3a5afe85a"><div class="ttname"><a href="group__hardware__timer.html#gac8ff547eecf2fd3eb1124cd3a5afe85a">timer_hardware_alarm_unclaim</a></div><div class="ttdeci">void timer_hardware_alarm_unclaim(timer_hw_t *timer, uint alarm_num)</div><div class="ttdoc">cooperatively release the claim on use of this hardware alarm_num on the given timer instance</div><div class="ttdef"><b>Definition:</b> timer.c:30</div></div>
<div class="ttc" id="agroup__hardware__timer_html_gaf2ca140ecc0d1e8087b584ed3707b80a"><div class="ttname"><a href="group__hardware__timer.html#gaf2ca140ecc0d1e8087b584ed3707b80a">hardware_alarm_callback_t</a></div><div class="ttdeci">void(* hardware_alarm_callback_t)(uint alarm_num)</div><div class="ttdef"><b>Definition:</b> timer.h:344</div></div>
<div class="ttc" id="agroup__timestamp_html_ga173698876ae00331c92ed4e8c3ba98d1"><div class="ttname"><a href="group__timestamp.html#ga173698876ae00331c92ed4e8c3ba98d1">to_us_since_boot</a></div><div class="ttdeci">static uint64_t to_us_since_boot(absolute_time_t t)</div><div class="ttdoc">convert an absolute_time_t into a number of microseconds since boot.</div><div class="ttdef"><b>Definition:</b> types.h:52</div></div>
<div class="ttc" id="agroup__timestamp_html_ga8b7f3d602cc053f05bacceeacc257ed8"><div class="ttname"><a href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a></div><div class="ttdeci">uint64_t absolute_time_t</div><div class="ttdoc">An opaque 64 bit timestamp in microseconds.</div><div class="ttdef"><b>Definition:</b> types.h:43</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="astructtimer__hw__t_html"><div class="ttname"><a href="structtimer__hw__t.html">timer_hw_t</a></div><div class="ttdef"><b>Definition:</b> timer.h:26</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>